﻿<%@ Page Language="C#" MasterPageFile="~/Template/Detail.master" AutoEventWireup="true"
    CodeFile="ClassMemberList.aspx.cs" Inherits="Page_ClassMemberList" Title="Untitled Page" %>

<%@ Register Src="~/Control/TabberHeader.ascx" TagName="TabberHeader" TagPrefix="wsc" %>
<%@ Register Src="~/Control/ListHeader.ascx" TagName="ListHeader" TagPrefix="wsc" %>
<%@ Register Assembly="Wicresoft.Common" Namespace="Wicresoft.Web.UI.WebControls"
    TagPrefix="wsc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link type="text/css" href="../css/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />

    <script type="text/javascript" src="../Js/jquery-1.3.2.min-vsdoc.js"></script>

    <script type="text/javascript" src="../Js/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../Js/jquery-ui-1.7.2.custom.min.js"></script>

    <script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">

        function ChangeDetailView1() {
            var height = document.body.clientHeight;
            var infoDetail = document.getElementById("trInfo1");
            if (infoDetail.style.display == 'none') {
                document.getElementById("imgExpand1").src = "../Images/Icon/icon-collapse.png";
                infoDetail.style.display = '';
            }
            else {
                document.getElementById("imgExpand1").src = "../Images/Icon/icon-expand.png";
                infoDetail.style.display = 'none';
            }
            PageResize();
        }
        function refrshDetail() {
            $("#<%=btnRefresh.ClientID %>").click();
        }
        function addMember() {
            var width = 530;
            var height = 600;

            //var returnValue = window.showModalDialog("Function.Web/UserChooser.aspx?SelectType=User&nocache=" + Math.random() * 10000 + "&ReturnValueFormat=" + encodeURI("<%=tbUserDisplayName.ClientID %>:DisplayName|<%=tbUserID.ClientID %>:ID|<%=tbUserName.ClientID %>:Name"), document, "dialogWidth:800px;dialogHeight:600px;status:yes;resizable:no");
            //document.getElementById("<%=btnAdd.ClientID %>").click();
            window.open("SelectClassMember.aspx?ApplyOrganID=<%=ApplyOrganID %>&ClassID=<%=ClassID %>&Nocache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);

        }
        function deleteMember() {
            document.getElementById("<%=btnDelete.ClientID %>").click();
        }
        $(function() {
            $("#dialog").dialog({ autoOpen: false });

        });
        function moveMember() {
            var noSelected = true;
            for (var i = 0; i < document.aspnetForm.elements.length; i++) {
                var e = document.aspnetForm.elements[i];
                if (e.type == "checkbox" && e.checked == true) {
                    noSelected = false;
                }
            }
            if (!noSelected) {
                $("#dialog").dialog({
                    height: 400, width: 400
                }).dialog("open")
            .parent().appendTo("#dialog_target");
            } else {
                alert("请选择学员！");
            }

        }
        function selectAll(cbSelecteAll) {
            for (var i = 0; i < document.aspnetForm.elements.length; i++) {
                var e = document.aspnetForm.elements[i];
                if (e.type == "checkbox") {
                    e.checked = cbSelecteAll.checked;
                }
            }
        }

        $(function() {
            $(".DivFloatRight").css("width", "100%");
        })
    </script>

    <style type="text/css">
        .FieldName
        {
            width: 70px;
        }
        .FieldInput
        {
            width: 130px;
        }
        .gotobtn
        {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 12px;
            height: 16px;
            width: 35px;
            color: #003677;
            border: solid 1px #5381B3;
            padding-left: 4px;
            padding-right: 4px;
            background: #F2F2F2;
        }
        .gototxt
        {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 9pt;
            color: Black;
            background-color: white;
            border: 1px solid #adb1c2;
            height: 16px;
        }
        .DivFloatLeft
        {
            height: 20px;
            float: left;
            width: 50%;
        }
        .DivFloatRight
        {
            height: 20px;
            text-align: right;
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ListToolBarPlaceHolder" runat="Server">
    <table cellspacing="2" cellpadding="0" border="0" id="tblOperator" runat="server">
        <tr runat="server" id="trToolMenu">
            <td class="ToolMenu">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="addMember();">
                    <span>
                        <img src="../Images/Icon/Object/tz-add.gif" alt="" /></span><span>新增</span>
                </div>
            </td>
            <td class="Fg">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
            <td class="ToolMenu">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="if(window.confirm('确定删除？')) deleteMember();">
                    <span>
                        <img src="../Images/Icon/Object/edit.gif" alt="" /></span><span>删除</span>
                </div>
            </td>
            <td class="Fg">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
            <td class="ToolMenu" style="display:none;">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="moveMember();">
                    <span>
                        <img src="../Images/Icon/Object/zsj-classifysend.gif" alt="" /></span><span>调整班次</span>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="InfoContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="TextContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="TabberContentPlaceHolder" runat="Server">
    <wsc:TabberHeader ID="thInfo" runat="server" DivID="div1" Title="学员列表" Selected="true" />
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Div1ContentPlaceHolder" runat="Server">
    <div style="display: none;">
        <asp:Button runat="server" ID="btnRefresh" OnClick="btnRefresh_Click" />
        <asp:TextBox ID="tbUserID" runat="server"></asp:TextBox>
        <asp:TextBox ID="tbUserName" runat="server"></asp:TextBox>
        <asp:TextBox ID="tbUserDisplayName" runat="server"></asp:TextBox>
        <asp:Button ID="btnAdd" runat="server" OnClick="btnAddUser_Click" />
        <asp:Button ID="btnAddApplyUser" runat="server" OnClick="btnAddApplyUser_Click" />
        <asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" />
        <div id="dialog" title="选择班次" class="ui-dialog">
            <table id="Table1" border="0" style="height: 200px; width: 300px;" cellspacing="0"
                cellpadding="0" class="FormTable tablefix">
                <tr>
                    <td>
                        <div style="text-align: left;">
                            班次：
                            <asp:DropDownList runat="server" ID="ddlOrder" AppendDataBoundItems="true">
                                <asp:ListItem Selected="True" Text="请选择" Value="请选择"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="text-align: center;">
                            <asp:Button runat="server" ID="btnAttendClass" OnClick="btnAttendClass_Click" Text="确定"
                                CssClass="Button01" />
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div id="dialog_target">
    </div>
    <table cellspacing="0" cellpadding="0" border="0" class="" width="100%"">
        <tr>
            <td class="DetailHeader">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tr>
                        <td class="ArticleTitle">
                            <asp:Literal ID="ltTitle" runat="server"></asp:Literal>
                        </td>
                        <td width="0" style="display: none;">
                            <a href="#">
                                <img src="../Images/Icon/icon-collapse.png" alt="字段" style="cursor: pointer;" onclick="ChangeDetailView1();"
                                    id="imgExpand1" /></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="trInfo1">
            <td>
                <div id="MainContent1">
                    <table cellspacing="0" cellpadding="0" border="0" class="PageGridHeader" width="100%">
                        <wsc:ListHeader Type="CheckBox" ID="lhcbUser" Align="center" runat="server" Width="30" />
                        <wsc:ListHeader ID="lhDepartment" runat="server" Title="&nbsp;单位" />
                        <wsc:ListHeader ID="lhMemberName" runat="server" Title="&nbsp;姓名" Width="100" />
                        <wsc:ListHeader ID="lhTotalScore" runat="server" Title="&nbsp;学分" Width="80" />
                        <wsc:ListHeader ID="lhStudyTime" runat="server" Title="&nbsp;培训天数" Width="80" />
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="MainInfolist">
                        <asp:Repeater ID="rptOrderInfo" OnItemDataBound="rptOrderInfo_OnItemDataBound" runat="server">
                            <ItemTemplate>
                                <tr id="TableRow_<%# Container.ItemIndex%>" style="cursor: hand; text-align: left;"
                                    class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                                    <td width="30" id="tdCb" runat="server" align="center">
                                        <asp:CheckBox ID="cbUser" runat="server" />
                                    </td>
                                    <td style="display: none;">
                                        <%# DataBinder.Eval(Container.DataItem,"ID") %>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "ThirdLevelDeptDisplayName")%>
                                    </td>
                                    <td width="100">
                                        <asp:Label runat="server" ID="lFullName" Text='<%# DataBinder.Eval(Container.DataItem, "MemberName")%>'></asp:Label>
                                    </td>
                                    <td width="80">
                                        <%# DataBinder.Eval(Container.DataItem, "TotalScore")%>
                                    </td>
                                    <td width="80">
                                        <%# DataBinder.Eval(Container.DataItem, "StudyTime")%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                    <wsc:DataPager ID="dpPager" runat="server" PageSize="20" Width="100%" GotoInputCssClass="gototxt"
                        GotoButtonCssClass="gotobtn" CssClass="TablePager" OnPreRender="dpPager_PreRender">
                    </wsc:DataPager>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Div2ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="TabberJSContentPlaceHolder" runat="Server">
    var height = document.body.clientHeight; var trInfo1 = document.getElementById("trInfo1");
    var MainContent1 = document.getElementById("MainContent1"); if (height > 119) { 
        trInfo1.style.height = height - 99 + "px";
        MainContent1.style.height = height - 119 + "px"; 
    }
</asp:Content>
